import { Navigate } from 'react-router-dom';
import { lazy } from "react";
const Home = lazy(() => import ('../pages/Home'))
const My  = lazy(() => import ('../pages/My'))
const Tabbar = lazy(() => import ('../pages/Tabbar'));
const Login = lazy(() => import ('../pages/Login'));
const Setting = lazy(() => import ('../pages/Setting'));
const WorkDetail = lazy(() => import ('../pages/WorkDetail'));
const MyData = lazy(() => import ('../pages/MyData'));
const Star = lazy(() => import ('../pages/Star'));
// eslint-disable-next-line import/no-anonymous-default-export
export default [
    {
        path: '/index',
        element: <Tabbar></Tabbar>,
        children: [
            {
                path: '/index/home',
                element: <Home></Home>
            },
            {
                path: '/index/my',
                element: <My></My>
            }
        ]
    },
    {
        path: '/login',
        element: <Login></Login>
    },
    {
        path: '/setting',
        element: <Setting></Setting>
    },
    {
        path: '/work/workDetail',
        element: <WorkDetail></WorkDetail>
    },
    {
        path: '/MyData/:q',
        element: <MyData></MyData>
    },
    {
        path: '/star',
        element: <Star></Star>
    },
    {
        path: '/*',
        element: <Navigate to='/index/home'></Navigate>
    }
];